package com.alisls.shequtao.service.goods.dao;

import com.alisls.shequtao.service.goods.entity.SpecParamDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

/**
 * 规格参数DAO
 *
 * @author Ke Wang
 */
public interface SpecParamDAO extends BaseMapper<SpecParamDO> {

    List<SpecParamDO> getSpecParamsBySpecGroupId(Long specGroupId);

    @Insert("insert into prd_spec_param (id, spec_group_id, spec_param_name, is_generic, is_numric, unit, segments, is_searching)" +
            "value (#{id}, #{specGroupDO.id}, #{specParamName}, #{isGeneric}, #{isNumric}, #{unit}, #{segments}, #{isSearching})"
    )
    Boolean saveSpecParamWithSpecGroup(SpecParamDO specParamDO);

}
